#!/bin/sh

TEMP_FILE=$(mktemp -p ${PWD} plotter.XXXXXXXXXX) && {
    
    ./test-fft-varianze ${@} > ${TEMP_FILE}
    
    gnuplot <<_EOF
set terminal jpeg
set output "${TEMP_FILE}.jpeg"
set title "FFT Gaussian Signal"
set zero 1e-11
set yrange [-1.50:128.25]
plot [0:255] "${TEMP_FILE}" using 1:6 title "Sigma 0.01" lt rgb "blue" with l, "${TEMP_FILE}" using 1:7 title "Sigma 0.05" lt rgb "orange" with l, "${TEMP_FILE}" using 1:8 title "Sigma 0.10" lt rgb "magenta" with l, "${TEMP_FILE}" using 1:9 title "Sigma 0.20" lt rgb "black" with l
_EOF

    rm -f "${TEMP_FILE}"
}

